package com.dlc.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dlc.shop.bean.model.SysAccessMenu;
import com.dlc.shop.dao.SysAccessMenuMapper;
import com.dlc.shop.service.SysAccessMenuService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 密钥对应可用菜单
 * @author LGH
 */
@Service
@AllArgsConstructor
public class SysAccessMenuServiceImpl extends ServiceImpl<SysAccessMenuMapper, SysAccessMenu> implements SysAccessMenuService {

    private final SysAccessMenuMapper sysAccessMenuMapper;

    @Override
    public List<Long> listMenuIdAccessId(Long accessId) {
        return list(new LambdaQueryWrapper<SysAccessMenu>().eq(SysAccessMenu::getSysAccessKeyId,accessId))
                .stream().map(SysAccessMenu::getMenuId).toList();
    }
}
